//
//  DTVerticalButton.m
//  DanTang
//
//  Created by honeyrr on 2017/10/10.
//  Copyright © 2017年 honeyrr. All rights reserved.
//

#import "DTVerticalButton.h"


@implementation DTVerticalButton
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.textColor = [UIColor grayColor];
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat margin = 10;
    //设置图片
    self.imageView.mr_x = margin;
    self.imageView.mr_y = margin;
    self.imageView.mr_width = self.mr_width / 2 + margin;
    self.imageView.mr_height = self.imageView.mr_width;
    self.imageView.mr_centerX = self.mr_width / 2;
    //设置文字
    self.titleLabel.mr_x = 0;
    self.titleLabel.mr_y = margin + self.imageView.mr_height;
    self.titleLabel.mr_width = self.mr_width;
    self.titleLabel.mr_height = self.mr_height - self.titleLabel.mr_y;
}

@end
